<template>
	<view class="wrap">
		<view class="menu">
			<view class="borderBottom column" v-for="(item, index) in menuInfo.list" :key="index" :class="menuInfo.base.class">
				<navigator :url="item.url" :class="item.class">
					<text v-text="item[ele]" v-for="(ele, index) in menuInfo.base.menuProp" :key="index"></text>
					<icon class="iconfont iconarrow-right-copy-copy next"></icon>
				</navigator>
			</view>
		</view>
	</view>
</template>

<script>
	import dormMixins from '@/libs/dormMixins.js'
	export default {
		mixins: [dormMixins],
		data() {
			return {
				pageOptions: '',
				menuInfo: {
					base: {
						menuProp: ['name']
					},
					list: []
				},
				pageParams: {
					pageNum: 1,
					pageSize: 20
				}
			};
		},
		onShow() {
			this.pageOptions = this.getPageOptions();
			this.fetchData(this.pageOptions);
		},
		methods: {
			async fetchData(pageOptions) {
				let list = await this.fetchRoom({...pageOptions, ...this.pageParams});
				this.menuInfo.list = list.map(item => {
					return {
						id: item.id,
						name: item.roomCode,
						url: `check?bdId=${pageOptions.bdId}&flrId=${pageOptions.flrId}&roomId=${item.id}`,
					};
				});
			},
		},
		components: {},
		computed: {

		}
	};
</script>

<style lang="scss" scoped>
	.search {
		width: 650upx;
		margin: 0 auto 20upx auto;
		border: 1upx solid #ddd;
		height: 60upx;
		border-radius: 30upx;
		position: relative;

		image {
			width: 50upx;
			height: 50upx;
			position: absolute;
			top: 5upx;
			left: 10upx;
		}

		input {
			width: 590upx;
			height: 50upx;
			position: absolute;
			left: 60upx;
			top: 5upx;
			color: #999;
			font-size: 28upx;
		}

		.input-placeholder {
			color: #999;
			font-size: 28upx;
		}
	}

	.menu {
		padding: 0 50upx 120upx 50upx;

		.column {
			display: flex;
			align-items: center;

			.choose {
				width: 30upx;
				height: 30upx;
				border-radius: 50%;
				background: #fff;
				margin: 0 10upx;
				font-size: 0;
				border: 1upx solid #ccc;
			}

			.chooseActive {
				width: 30upx;
				height: 30upx;
				border-radius: 50%;
				font-size: 22upx;
				background: #3ED392;
				color: #fff;
				margin: 0 10upx;
				line-height: 30upx;
				text-align: center;
			}

		}

		navigator {
			flex: 0 1 100%;
			height: 80upx;
			line-height: 80upx;
			display: flex;
			justify-content: space-between;
			align-items: center;
		}

		.tit {
			display: flex;
			justify-content: space-between;

			text {
				font-size: 28upx;
				line-height: 100upx;
				font-weight: 600;
			}
		}

		.next {
			margin-left: auto;
			float: right;
		}
	}

	page {
		min-height: 100%;

		.wrap {
			min-height: 100%;
			padding-top: 20upx;
		}

		.submitButtonActive {
			position: fixed;
			bottom: 20upx;
			left: 50%;
			transform: translateX(-50%);
		}
	}
</style>
